﻿@model WebDomain.Entities.Product

@{
    ViewBag.Title = "Admin: Edit " +@Model.Name;
}

<h2>Edit @Model.Name</h2>

@using (Html.BeginForm("Edit", "Admin",FormMethod.Post, new { enctype = "multipart/form-data"}))
{
    @Html.EditorForModel()
    <br />
    <div class="editor-label">Image</div>
    <div class="editor-field">
        @if (Model.ImageData==null)
        {
            @:None
        }
        else
        {
            <img width="150" src="~/@Url.Action("GetImage","Product",new{Model.ID})" alt="@Model.Name"/>
        }

        <div>Upload new image: <input type="file" name="Image"/></div>
    </div>
    <input type="submit" value="Save" />
    @Html.ActionLink("Cancel", "Products")
}